package com.qiji.video.service.impl;

import com.qiji.video.bean.VideoPartition;
import com.qiji.video.mapper.VideoPartitionMapper;
import com.qiji.video.mapper.extend.VideoPartitionExtendMapper;
import com.qiji.video.service.IPartitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PartitionServiceImpl implements IPartitionService {
    @Autowired
    private VideoPartitionMapper videoPartitionMapper;

    @Autowired
    private VideoPartitionExtendMapper videoPartitionExtendMapper;

    @Override
    public List<VideoPartition> selectPartition() {
        return videoPartitionExtendMapper.selectAll();
    }

    @Override
    public void deletePartition(Integer id) {
        videoPartitionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updatePartition(VideoPartition videoPartition) {
        videoPartitionMapper.updateByPrimaryKeySelective(videoPartition);
    }

    @Override
    public void insertPartition(VideoPartition videoPartition) {
        videoPartitionMapper.insertSelective(videoPartition);
    }
}
